dojo.provide("dojoscratch.RectangleCommand");

dojo.require("dojoscratch.AbstractCommand");

dojo.declare("dojoscratch.RectangleCommand", dojoscratch.AbstractCommand, {
	_command: function() {
		var rect = {
			"type" : "rect",
			"x" : Math.min(this._x1, this._x2),
			"y" : Math.min(this._y1, this._y2),
			"width" : Math.abs(this._x1-this._x2),
			"height" : Math.abs(this._y1-this._y2),
			"r" : 0
		};
		var fill = {
			colors : {
//				color: "green"
			}
		};
		var stroke = {
				colors : "black",
				width: 2
		};
		
		this._createScratch(rect, fill, stroke);
	}
});